// 空白验证
function stringEmptyValidator(rule, value, callback) {
  if (value.length === 0) {
    return callback(new Error("输入不能为空"));
  }
  if (value.startsWith(" ") || value.endsWith(" ")) {
    return callback(new Error("首尾不能有空白字符"));
  }
  return callback();
}

function startEndEmptyValidator(rule, value, callback) {
  if (value.startsWith(" ") || value.endsWith(" ")) {
    return callback(new Error("首尾不能有空白字符"));
  }
  return callback();
}

export { stringEmptyValidator, startEndEmptyValidator };
